package day04;

import java.util.Scanner;

public class ExTest01 {
    public static void main(String[] args) {
        /**
         * 利用循环语句计算数字1到100的和
         */
        System.out.println("计算1到100的和");
        int num1=1;int num=0;
        while (num1<=100){

             num+=num1;
             num1++;
        }
        System.out.println(num);


    /**
     * 加强 计算输入两数之间的和
     *
     */
    Scanner scanner=new Scanner(System.in);
      int num02=scanner.nextInt();
      int num03=scanner.nextInt();
      int min=num02<num03?num02:num03;
      int max=num02>num03?num02:num03;
        int together=0;
      while (min<=max){
         together+=min;
         min++;

      }
      System.out.println(together);


    }


}
